/****************************************************************************
 * Copyright (C) 2025 Chenyz. All rights reserved.
 *
 * @file    TinyOS_MailBox.h
 *
 * @par     dependencies
 *          - stdint.h (Standard integer types)
 *          - TinyOS_Types.h (Type definitions)
 *
 * @author  Chenyz
 *
 * @brief   Mailbox Management Header
 *          This file provides declarations for message mailbox operations
 *          in TinyOS, including:
 *          - Mailbox initialization and buffer configuration
 *          - Message sending and receiving with priority support
 *          - Blocking and non-blocking message operations
 *          - Mailbox cleanup and information retrieval
 *
 * @version V1.0
 * @date    2025-10-03
 *
 * @note    This module implements message mailboxes for inter-task
 *          communication with configurable buffer sizes and priorities.
 ****************************************************************************/

#ifndef __TINYOS_MAILBOX_H__
#define __TINYOS_MAILBOX_H__

/******************************** Includes **********************************/
#include <stdint.h>
#include "TinyOS_Types.h"

/*************************** Function Declarations **************************/

/* Mailbox management functions */
void TinyOS_MailBoxInit(
    TinyOS_MailBoxType* MailBox,
    void** MsgBuffer,
    uint32_t MaxCount
);
uint32_t TinyOS_MailBoxGive(    
    TinyOS_MailBoxType* MailBox,
    void* Msg,
    uint32_t MailPriority
);
uint32_t TinyOS_MailBoxTakeNoWait(
    TinyOS_MailBoxType* MailBox,
    void** Msg
);
uint32_t TinyOS_MailBoxTake(
    TinyOS_MailBoxType* MailBox,
    void** Msg,
    uint32_t WaitTicks
);
void TinyOS_MailBoxGetInfo(
    TinyOS_MailBoxType* MailBox,
    TinyOS_MailBoxInfo* Info
);    
uint32_t TinyOS_MailBoxDeleteWait(TinyOS_MailBoxType* MailBox);
void TinyOS_MailBoxFlush(TinyOS_MailBoxType* MailBox);

#endif /* __TINYOS_MAILBOX_H__ */

